<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>load事件案例</title>
    <script>
        // window.onload=function() {
        //     var mydiv = document.getElementById("mydiv");
        //     alert("页面加载完成，mydiv的内容是："+mydiv.innertext);
        // }
        function imgload() {
            myimg = document.getElementById('myimg');
            // 图片加载完成后，给图片加边框
            myimg.style.border='9px solid #00ff00';
            alert('图片加载完成，给他加边框。')
        }
    </script>
</head>
<body>
    <!-- <div id="mydiv">我有一个好主意</div> -->
    <img id="myimg" src="../../images/1599370107075.jpg" onload="imgload()">
</body>
</html>